<!--#begin vrightslist -->
<script language="JavaScript">
<!--
function dateBegin(day, month, year)
{
	document.vacfrights.elements['dateb'].value = day+'-'+month+'-'+year;
}

function dateEnd(day, month, year)
{
	document.vacfrights.elements['datee'].value = day+'-'+month+'-'+year;
}
//-->
</script>

<table width="99%" border="0" cellspacing="0" cellpadding="2" align="center">
<tr> 
<td class="BabLoginCadreBackground"> 
	<table width="100%" border="0" cellspacing="0" cellpadding="5" align="center">
		<tr class="BabSiteAdminTitleFontBackground">
			<td>{ desctxt }</td>
			<td>{ typetxt }</td>
			<td align="center">{ t_edit }</td>
			<td align="center">{ statustxt }</td>
			<td>{ t_available }</td>
			<td align="center">{ quantitytxt }</td>
			<td>&nbsp;</td>
		</tr>
        <!--#in getnext -->
        <!--#if altbg --><tr class="BabSiteAdminFontBackground"><!--#else altbg --><tr class="BabForumBackground1"><!--#endif altbg -->
			<td>
				<a href="javascript: Start('{ vrviewurl }', 'OviListPr', 'width=650,height=500,status=no,resizable=yes,top=200,left=200,scrollbars=yes');">{ description }</a>
			</td>
			<td>{ typename }</td>
			<td align="center">
				<a href="{ vrurl }" title="{ creditortxt } : { creditor }"><img src="{ babSkinPath }images/Puces/edit.gif" border="0" alt="{ alttxt }" /></a>
			</td>
			<td align="center">
				<!--#if bclose -->
				<img src="{ babSkinPath }images/Puces/action_fail.gif" alt="{ closedtxt }" />
				<!--#else bclose -->
				<img src="{ babSkinPath }images/Puces/action_success.gif" alt="{ openedtxt }" />
				<!--#endif bclose -->
			</td>
			<td>{ available }</td>
			<td align="center">{ quantity }</td>
			<td width="1%"><a href="javascript: Start('{ urllistp }', 'OviListPr', 'width=650,height=500,status=no,resizable=yes,top=200,left=200,scrollbars=yes');" title="{ altlistp }"><img src="{ babSkinPath }images/Puces/PuceUserAttrib.gif" alt="{ altlistp }" border="0" align="middle" /></a></td>
        </tr>
        <!--#endin getnext -->
		<tr class="BabSiteAdminTitleFontBackground">
			<td> 
				&nbsp; 
				<!--#if topurl --><a href="{ topurl }"><img src="{ babSkinPath }images/Puces/arrowPrev3aa.gif" alt="{ t_first_page }" /></a><!--#endif topurl -->
				<!--#if prevurl --><a href="{ prevurl }"><img src="{ babSkinPath }images/Puces/arrowPrev3a.gif" alt="{ t_previous_page }" /></a><!--#endif prevurl -->
			</td>

			<td colspan="4" align="center">
				{ t_position }
			</td>

			<td colspan="2" align="right"> 

				<!--#if nexturl --><a href="{ nexturl }"><img src="{ babSkinPath }images/Puces/arrowNext3a.gif" alt="{ t_next_page }" /></a><!--#endif nexturl -->
				<!--#if bottomurl --><a href="{ bottomurl }"><img src="{ babSkinPath }images/Puces/arrowNext3aa.gif" alt="{ t_last_page }" /></a><!--#endif bottomurl -->
				&nbsp; 
			</td>
		</tr>
</table>
</td>
</tr>

</table>

<br>
<form name="vacfrights" method="post" action="{ babPhpSelf }" >
<input type="hidden" name="tg" value="vacadma">
<input type="hidden" name="idx" value="lrig">
<input type="hidden" name="pos" value="{ pos }">
<table border="0" width="99%" cellpadding="2" cellspacing="0" align="center">
<tr>
<td class="BabLoginCadreBackground"> 
	<table border="0" width="100%" cellpadding="2" cellspacing="0" class="BabLoginMenuBackground">
	<tr  align="center"> 
		<td>{ typetxt }</td>
		<td>{ statustxt }</td>
		<td>{ creditortxt }</td>
		<td></td>
	</tr>
	<tr align="center"> 
		
		<td> 
			<select name="idtype">
			<option value=""></option>
			<!--#in getnexttype -->
			<option value="{ typeid }" { selected }>{ typename }</option>
			<!--#endin getnexttype -->
			</select>
		</td>
		<td> 
			<select name="active">
			<option value=""></option>
			<option value="Y" { yselected }>{ activeyes }</option>
			<option value="N" { nselected }>{ activeno }</option>
			</select>
		</td>
		<td> 
			<select name="idcreditor">
			<option value=""></option>
			<!--#in getnextcreditor -->
			<option value="{ creditorid }" { selected }>{ creditorname }</option>
			<!--#endin getnextcreditor -->
			</select>
		</td>
	</tr>

	<tr>
		<td colspan="3"> { date2txt } : 
			{ begintxt }
			<input type="text" name="dateb" size="10" maxlength="10" value="{ dateb }" />
			&nbsp;<a href="#" onclick="Start('{ dateburl }', 'CalendarWindow', 'width=250,height=250,status=no,resizable=no,top=200,left=200');return false;"><img src="{ babSkinPath }images/Puces/calendar.gif" alt="{ begintxt }" border="0" align="absmiddle" /></a>&nbsp;{ endtxt }
			<input type="text" name="datee" size="10" maxlength="10" value="{ datee }" />&nbsp;<a href="javascript: Start('{ dateeurl }', 'CalendarWindow', 'width=250,height=250,status=no,resizable=no,top=200,left=200');"><img src="{ babSkinPath }images/Puces/calendar.gif" alt="{ endtxt }" border="0" align="absmiddle" /></a>
		</td>
	</tr>
	<tr>
		<td colspan="3" align="center">
			<input type="submit" name="submit" value="{ filteron }" />
		</td>
	</tr>
	</table>
</td>
</tr>
</table>
</form>
<!--#end vrightslist -->



<!--#begin rightsedit -->

<script type="text/javascript">
<!--
function use_rules_change(obj)
{
var tb_rules = document.getElementById('vac_right_rules');
var tb_com = document.getElementById('vac_right_common');
var tb_fixed = document.getElementById('vac_right_fixed');

	switch (obj.value)
	{
		case '0':
			tb_rules.style.display = 'none';
			tb_com.style.display = '';
			tb_fixed.style.display = 'none';
		break;
		case '1':
			tb_rules.style.display = '';
			tb_com.style.display = '';
			tb_fixed.style.display = 'none';
		break;
		case '2':
			tb_rules.style.display = 'none';
			tb_com.style.display = 'none';
			tb_fixed.style.display = '';
		break;
	}
}

function calwin(linkobj)
{
	bab_dialog.selectdate(function(arr) {
	
		var intput = linkobj;
		
		while (intput.nodeName != 'INPUT') {
 			intput = intput.nextSibling;
		}
	
		intput.value = arr['day']+'-'+arr['month']+'-'+arr['year'];
	});
}




function validateForm(fr)
{
	if (fr.elements['id_groups[]']) {
		var sel_groups = fr.elements['id_groups[]'];
		for (i = sel_groups.options.length; i > 0 ; i--) {
			sel_groups.options[i-1].selected = true;
		}
	}
	
	var ret = true;

	if( 
		fr.righttype.options[fr.righttype.selectedIndex].value == 0 || 
		fr.righttype.options[fr.righttype.selectedIndex].value == 1
		)
	{
		return true;
	}
	if( fr.yearbeginfx.selectedIndex > fr.yearendfx.selectedIndex )
		{
		ret = false;
		}
	else if( fr.yearbeginfx.selectedIndex == fr.yearendfx.selectedIndex )
		{
			if( fr.monthbeginfx.selectedIndex > fr.monthendfx.selectedIndex )
			{
			ret = false;
			}
			else if( fr.monthbeginfx.selectedIndex == fr.monthendfx.selectedIndex ) 
			{
			if( fr.daybeginfx.selectedIndex > fr.dayendfx.selectedIndex )
				{
				ret = false;
				}
			}
		}

	if( ret == false)
		{
		var d1;
		alert ('{ invaliddate }');
		return false;
		}

	dateA = new Date(fr.yearbeginfx.options[fr.yearbeginfx.selectedIndex].text, fr.monthbeginfx.options[fr.monthbeginfx.selectedIndex].value-1, fr.daybeginfx.options[fr.daybeginfx.selectedIndex].text );
	
	dateB = new Date(fr.yearendfx.options[fr.yearendfx.selectedIndex].text, fr.monthendfx.options[fr.monthendfx.selectedIndex].value-1, fr.dayendfx.options[fr.dayendfx.selectedIndex].text );

	dayb = fr.halfdaybeginfx.options[fr.halfdaybeginfx.selectedIndex].value;
	daye = fr.halfdayendfx.options[fr.halfdayendfx.selectedIndex].value;
	diff = ((dateB - dateA)/86400000)+1;
	if( diff == 1 )
	{
		if( dayb == 0 && daye ==1  && fr.quantity.value != 1)
		{
		ret = false;
		}
		else if( (daye == 0 || dayb == 1) && fr.quantity.value != '0.5')
		{
		ret = false;
		}
	}
	else if( fr.quantity.value > diff ) { ret = false; }
	

	if( ret == false) { 
	var d1; 
	alert ('{ invalidtotal }'); 
	return false;
	}
	return true;
}




function onAssignmentType(sel) {

	if (!sel) {
		return;
	}

	for(i = 1 ; i <= 3; i++) {
		obj = document.getElementById('bab_vac_assignment_type_'+i);
		obj.style.display = 'none';
	}

	val = sel.value;
	obj = document.getElementById('bab_vac_assignment_type_'+val);
	obj.style.display = '';
}


function opengroups() {
	bab_dialog.selectgroups( function(arr) {
			var group;
			var sel_groups = document.forms['rightsedit'].elements['id_groups[]'];
			for (var i = 0; i < arr.length; i++) {
				group = arr[i];
				opt = new Option(group.content, group.id);
				sel_groups.options[sel_groups.options.length] = opt;
			}
		},

		'selectable_groups&multi'
	);
}


function group_delete_selected() {
	var sel_groups = document.forms['rightsedit'].elements['id_groups[]'];
	for (i = sel_groups.options.length; i > 0 ; i--) {
		if (sel_groups.options[i-1].selected) {
			sel_groups.options[i-1] = null;
		}
	}
}

//-->
</script>

<form name="rightsedit" method="post" action="{ babPhpSelf }"  onSubmit="return validateForm(this);">
	<input type="hidden" name="tg" value="vacadma">
	<input type="hidden" name="idx" value="lrig">
	<input type="hidden" name="action" value="rightsedit">
	<input type="hidden" name="idvr" value="{ arr[idvr] }">
	<input type="hidden" name="year" value="{ year }">
	<table  border="0" cellspacing="0" cellpadding="2" align="center">
	<tr> 
		<td class="BabLoginCadreBackground"> 
			<table class="BabLoginMenuBackground" width="100%" border="0" cellspacing="0" cellpadding="5">
			<tr> 
				<td align="right">{ t_right_type }:</td>
				<td > 
					<select name="righttype" onchange="use_rules_change(this)">
					<!--#in getnextrighttype -->
					<option value="{ righttypeid }" { selected }>{ righttypeval }</option>
					<!--#endin getnextrighttype -->
					</select>
				</td>
			</tr>
			<tr> 
				<td align="right">{ t_description }:</td>
				<td> 
					<input type="text" name="description" size="45" maxlength="255" value="{ arr[description] }" />
				</td>
			</tr>
			
			<tr> 
				<td align="right">{ t_period }:</td>
				<td> 
					{ t_date_begin }
					<input type="text" name="date_begin" size="10" maxlength="10" value="{ arr[date_begin] }" />&nbsp;<a href="#" onclick="calwin(this.previousSibling.previousSibling);return false;"><img src="{ babSkinPath }images/Puces/calendar.gif" alt="t_date_begin" border="0" align="absmiddle" /></a>
					&nbsp;{ t_date_end }
					<input type="text" name="date_end" size="10" maxlength="10" value="{ arr[date_end] }" />&nbsp;<a href="#" onclick="calwin(this.previousSibling.previousSibling);return false;"><img src="{ babSkinPath }images/Puces/calendar.gif" alt="" border="0" align="absmiddle" /></a>
				</td>
			</tr>


			<!--#if arr[idvr] -->
			
			<tr> 
				<td align="right">{ t_id_type }:</td>
				<td>
					{ arr[type] }
					<input type="hidden" name="type" value="{ arr[type] }" />
				</td>
			</tr>

			<!--#else arr[idvr] -->
			
			<tr> 
				<td align="right">{ t_id_type }:</td>
				<td>
					<select name="id_type" onChange="mmvac(this.selectedIndex)">
					<!--#in getnexttype -->
					<option value="{ typeid }" { selected }>{ typename }</option>
					<!--#endin getnexttype -->
					</select>
				</td>
			</tr>

			<!--#endif arr[idvr] -->

			<tr> 
				<td align="right">{ t_id_rgroup }:</td>
				<td>
					<select name="id_rgroup">
						<option value=""></option>
					<!--#in getnextrgroup -->
						<option value="{ rg_id }" <!--#if selected --> selected="selected" <!--#endif selected -->>{ rg_name }</option>
					<!--#endin getnextrgroup -->
					</select>
				</td>
			</tr>
			
			<tr> 
				<td align="right">{ t_quantity }:</td>
				<td> 
					<input type="text" name="quantity" size="5" maxlength="5" value="{ arr[quantity] }" onBlur="validateNum(this)" />&nbsp;&nbsp;{ t_days }
				</td>
			</tr>
			
			<tr> 
				<td align="right">{ t_active }:</td>
				<td> 
					<!--#if arr[active] "== Y" -->
					<input type="checkbox" name="active" value="Y" checked="checked" />
					<!--#else arr[active] -->
					<input type="checkbox" name="active" value="Y" />
					<!--#endif arr[active] -->
				</td>
			</tr>
			<tr> 
				<td align="right">{ t_cbalance }:</td>
				<td > 
					<select name="cbalance">
					<!--#if arr[cbalance] "== Y" -->
					<option value="Y" selected="selected">{ yes }</option>
					<option value="N">{ no }</option>
					<!--#else arr[cbalance] -->
					<option value="Y">{ yes }</option>
					<option value="N" selected="selected">{ no }</option>
					<!--#endif arr[cbalance] -->
					</select>
				</td>
			</tr>
			<tr> 
				<td align="right">{ t_no_distribution }:</td>
				<td > 
					<select name="no_distribution">
					<!--#if arr[no_distribution] -->
					<option value="1" selected="selected">{ no }</option>
					<option value="0">{ yes }</option>
					<!--#else arr[no_distribution] -->
					<option value="1">{ no }</option>
					<option value="0" selected="selected">{ yes }</option>
					<!--#endif arr[no_distribution] -->
					</select>
				</td>
			</tr>


			<!--#if arr[idvr] -->
			
			<!--#else arr[idvr] -->

			<tr> 
				<td colspan="2">
				
				<fieldset>
						<legend>{ t_assignment }</legend>
						<br />
						<label for="bab_vac_assignment_type">{ t_assignment_type }</label> : 
						<select id="bab_vac_assignment_type" name="assignment_type" onchange="onAssignmentType(this)">
							<option value="1" <!--#if assignment_type "== 1" --> selected="selected"<!--#endif assignment_type -->>{ t_by_user }</option>
							<option value="2" <!--#if assignment_type "== 2" --> selected="selected"<!--#endif assignment_type -->>{ t_by_coll }</option>
							<option value="3" <!--#if assignment_type "== 3" --> selected="selected"<!--#endif assignment_type -->>{ t_by_group }</option>
						</select>


						<br />
						<br />
	
						<div id="bab_vac_assignment_type_1">
							<a href="javascript: openPopup('{ usersbrowurl }');">{ t_id_creditor }</a> :
							<input type="text" name="id_creditorDisplay" size="45" maxlength="255" value="{ arr[id_creditorDisplay] }" disabled="disabled" />
							<input type="hidden" name="id_creditor" value="{ arr[id_creditor] }" />
						</div>

						<div id="bab_vac_assignment_type_2">
							{ t_collid } : 
							<select name="collid" onchange="onCollection()">
								<option value=""></option>
								<option value="-2">{ t_allcol }</option>
								<option value="-1">{ t_allpers }</option>
							</select>

						</div>

						<div id="bab_vac_assignment_type_3">
							<table>
							<tr>
								<td valign="top" align="right">
									<p><a href="#" onclick="opengroups();return false;">{ t_id_groups }</a> : </p>
									<p>
										<img src="{ babSkinPath }images/Puces/del.gif" onclick="group_delete_selected()" style="cursor:pointer" />
									</p>
								</td>
								<td>
									<select name="id_groups[]" multiple="multiple" size="5">
									</select>
								</td>
							</tr>
							</table>
						</div>
				
				</fieldset>

				</td>
			</tr>

			<!--#endif arr[idvr] -->

			<tbody id="vac_right_fixed">
			<tr> 
				<td align="right">{ t_datebegintxt }:</td>
				<td> 
				<select name="daybeginfx"">
				<!--#in getnextday -->
				<option value="{ t_dayid }" { selected }>{ t_dayid }</option>
				<!--#endin getnextday -->
				</select>&nbsp;
				<select name="monthbeginfx" onChange="updateDates(this.form.daybeginfx, this.form.monthbeginfx, this.form.yearbeginfx);">
				<!--#in getnextmonth -->
				<option value="{ monthid }" { selected }>{ t_monthname }</option>
				<!--#endin getnextmonth -->
				</select>&nbsp;
				<select name="yearbeginfx" onChange="updateDates(this.form.daybeginfx, this.form.monthbeginfx, this.form.yearbeginfx);">
				<!--#in getnextyear -->
				<option value="{ yearid }" { selected }>{ t_yearidval }</option>
				<!--#endin getnextyear -->
				</select>&nbsp;
				<select name="halfdaybeginfx">
				<!--#in getnexthalf -->
				<option value="{ halfid }" { selected }>{ t_halfname }</option>
				<!--#endin getnexthalf -->
				</select>
				</td>
			</tr>
			<tr> 
				<td align="right">{ t_dateendtxt }:</td>
				<td> 
				<select name="dayendfx">
				<!--#in getnextday -->
				<option value="{ t_dayid }" { selected }>{ t_dayid }</option>
				<!--#endin getnextday -->
				</select>&nbsp;
				<select name="monthendfx" onChange="updateDates(this.form.dayendfx, this.form.monthendfx, this.form.yearendfx);">
				<!--#in getnextmonth -->
				<option value="{ monthid }" { selected }>{ t_monthname }</option>
				<!--#endin getnextmonth -->
				</select>&nbsp;
				<select name="yearendfx" onChange="updateDates(this.form.dayendfx, this.form.monthendfx, this.form.yearendfx);">
				<!--#in getnextyear -->
				<option value="{ yearid }" { selected }>{ t_yearidval }</option>
				<!--#endin getnextyear -->
				</select>&nbsp;
				<select name="halfdayendfx">
				<!--#in getnexthalf -->
				<option value="{ halfid }" { selected }>{ t_halfname }</option>
				<!--#endin getnexthalf -->
				</select>
				</td>
			</tr>
			</tbody>
			<tbody id="vac_right_common">
			<tr> 
				<td colspan="2">
					<br />
					<fieldset>
						<legend>{ t_periodvalid }</legend>
						<br />
						<p>{ t_periodvalid_help1 }</p>
						<p>
						<a href="#" onclick="calwin(this);return false;">{ t_date_begin }</a>
						<input type="text" name="date_begin_valid" size="10" maxlength="10" value="{ arr[date_begin_valid] }" />
						 &nbsp; 
						<a href="#" onclick="calwin(this);return false;">{ t_date_end }</a>
						<input type="text" name="date_end_valid" size="10" maxlength="10" value="{ arr[date_end_valid] }" />
						</p>
						<p>{ t_periodvalid_help2 }</p>
					</fieldset>
				</td>
			</tr>
			
			
			</tbody>
			<tbody id="vac_right_rules">

				<tr> 
					<td colspan="2" align="left">
						<br />
					
						<fieldset>
						<legend>{ t_zoneapplication }</legend>
						
						<br />
						
						<p>{ t_right_inperiod }</p>
							
						<div id="bab_vac_rights_inperiod_contener">
						<!--#in getnextinperiod -->
							<p><select name="right_inperiod[]">
									<!--#if right_inperiod "== 2" -->
									<option value="1">{ t_inperiod }</option>
									<option value="2" selected="selected">{ t_outperiod }</option>
									<!--#else right_inperiod -->
									<option value="1" selected="selected">{ t_inperiod }</option>
									<option value="2">{ t_outperiod }</option>
									<!--#endif right_inperiod -->
								</select>{ t_period_rule } : <a href="#" onclick="calwin(this);return false;">{ t_period_start }</a><input type="text" name="period_start[]" maxlength="10" value="{ period_start }" /><a href="#" onclick="calwin(this);return false;">{ t_period_end }</a><input type="text" name="period_end[]" maxlength="10" value="{ period_end }" /><!--#if removebutton --><a href="#" onclick="bab_vac_rights_inperiod_remove(this.parentNode);return false;"><img src="{ babSkinPath }images/Puces/PuceDelete.png" alt="" /></a>
								<!--#endif removebutton -->
							</p>
						<!--#endin getnextinperiod -->
						</div>
						
						<p>
							<a href="#" onclick="bab_vac_rights_inperiod_add(this.parentNode);return false;"><img src="{ babSkinPath }images/Puces/edit_add.png" alt="" align="absmiddle" />&nbsp;{ t_add_period }</a>
						</p>

						<!--#if arr[validoverlap] -->
						<p><input type="checkbox" name="validoverlap" value="1" checked="checked" /> { t_validoverlap } </p>
						<!--#else arr[validoverlap] -->
						<p><input type="checkbox" name="validoverlap" value="1" /> { t_validoverlap } </p>
						<!--#endif arr[validoverlap] -->
							
						
						</fieldset>

						<script type="text/javascript">
						
							function bab_vac_rights_inperiod_add() {
							
								var p = document.createElement('p');
								var sel = document.createElement('select');
								sel.name = 'right_inperiod[]';
								
								var opt1 = document.createElement('option');
								opt1.appendChild(document.createTextNode('{ t_inperiod_js }'));
								opt1.value='1';
								sel.appendChild(opt1);
								
								var opt2 = document.createElement('option');
								opt2.appendChild(document.createTextNode('{ t_outperiod_js }'));
								opt2.value='2';
								sel.appendChild(opt2);
								
								p.appendChild(sel);
								
								p.appendChild(document.createTextNode('{ t_period_rule } : '));
								
								var a1 = document.createElement('a');
								a1.href='#';
								a1.appendChild(document.createTextNode('{ t_period_start }'));
								Event.observe(a1, 'click', function(evt) {
									calwin(Event.element(evt));
									Event.stop(evt);
								}, false);
								p.appendChild(a1);
								
								var input1 = document.createElement('input');
								input1.name = 'period_start[]';
								input1.maxlength = 10;
								p.appendChild(input1);
								
								var a2 = document.createElement('a');
								a2.href='#';
								a2.appendChild(document.createTextNode('{ t_period_end }'));
								Event.observe(a2, 'click', function(evt) {
									calwin(Event.element(evt));
									Event.stop(evt);
								}, false);
								p.appendChild(a2);
								
								var input2 = document.createElement('input');
								input2.name = 'period_end[]';
								input2.maxlength = 10;
								p.appendChild(input2);
								
								var a3 = document.createElement('a');
								a3.href='#';
								Event.observe(a3, 'click', function(evt) {
									var clicked = Event.element(evt);
									bab_vac_rights_inperiod_remove(clicked.parentNode.parentNode);
									Event.stop(evt);
								}, false);
								
								var img = document.createElement('img');
								img.src = '{ babSkinPath }images/Puces/PuceDelete.png';
								img.alt= '';
								a3.appendChild(img);
								p.appendChild(a3);
								
								$('bab_vac_rights_inperiod_contener').appendChild(p);
							}
							
							
							function bab_vac_rights_inperiod_remove(obj) {
								obj.parentNode.removeChild(obj);
							}
						
						
						</script>

					</td>
				</tr>


				<tr> 
					<td colspan="2" align="left">
						<br />
						<fieldset>
						<legend>{ t_trigger }</legend>
						<br />
						
						<p>{ t_trigger_nbdays }</p>
						
						<p>
						{ t_at_least }&nbsp;:&nbsp;<input type="text" name="trigger_nbdays_min" size="5" maxlength="10" value="{ arr[trigger_nbdays_min] }" onBlur="validateNum(this)" />&nbsp;&nbsp;{ t_days } 
						
						{ t_but_less_than }&nbsp;:&nbsp;<input type="text" name="trigger_nbdays_max" size="5" maxlength="10" value="{ arr[trigger_nbdays_max] }" onBlur="validateNum(this)" />&nbsp;&nbsp;{ t_days }</p>
						
						<br />
						
						<p>
							{ t_vacation_type } : 
							<select name="trigger_type">
								<option value="0">{ t_all }</option>
								<!--#in getnexttype -->
								<option value="{ typeid }">{ typename }</option>
								<!--#endin getnexttype -->
							</select>
						</p>

						<br />

						<p>
							{ t_trigger_p1 } : 

							<a href="#" onclick="calwin(this);return false;">{ t_date_begin }</a>
							<input type="text" name="trigger_p1_begin" size="10" maxlength="10" value="{ arr[trigger_p1_begin] }" />
							 &nbsp; 
							<a href="#" onclick="calwin(this);return false;">{ t_date_end }</a>
							<input type="text" name="trigger_p1_end" size="10" maxlength="10" value="{ arr[trigger_p1_end] }" />
						</p>

						<p>
							{ t_trigger_p2 } : 

							<a href="#" onclick="calwin(this);return false;">{ t_date_begin }</a>
							<input type="text" name="trigger_p2_begin" size="10" maxlength="10" value="{ arr[trigger_p2_begin] }" />
							 &nbsp; 
							<a href="#" onclick="calwin(this);return false;">{ t_date_end }</a>
							<input type="text" name="trigger_p2_end" size="10" maxlength="10" value="{ arr[trigger_p2_end] }" />
						</p>

						<!--#if arr[trigger_overlap] -->
						<p><input type="checkbox" name="trigger_overlap" value="1" checked="checked" /> { t_trigger_overlap } </p>
						<!--#else arr[trigger_overlap] -->
						<p><input type="checkbox" name="trigger_overlap" value="1" /> { t_trigger_overlap } </p>
						<!--#endif arr[trigger_overlap] -->


						</fieldset>

						<br />

						<script type="text/javascript">
						<!--
						document.forms['rightsedit'].trigger_type.value = '{ arr[trigger_type] }';
						-->
						</script>
					</td>
				</tr>
			</tbody>
			<tr> 
				<td colspan="2" align="center"> 
					<input type="submit" name="submit" value="{ t_record }" />&nbsp;&nbsp;
					
					<!--#if arr[idvr] -->
					<input type="submit" name="deleteg" value="{ t_delete }" />
					<!--#else arr[idvr] -->
					<input type="button" name="breset" value="{ t_reset }" onclick="babReset()" />
					<!--#endif arr[idvr] -->
					<br>
				</td>
			</tr>
			</table>
		</td>
	</tr>
	</table>
</form>
<br />

<script type="text/javascript">
<!--


onAssignmentType(document.forms['rightsedit'].assignment_type);

use_rules_change(document.forms['rightsedit'].righttype);

<!--#if arr[idvr] -->
<!--#else arr[idvr] -->
var tpsel = { tpsel };
var colsel = { colsel };
var tabvacn = new Array({ counttype });
var tabvaci = new Array({ counttype });
var tabvacb = new Array({ counttype });
<!--#in getnexttype -->
tabvacb[{ iindex }] = { tcbalance };
tabvacn[{ iindex }] = new Array();
tabvaci[{ iindex }] = new Array();
<!--#in getnextcol -->
tabvacn[{ iindex }][tabvacn[{ iindex }].length] = "{ collval }";
tabvaci[{ iindex }][tabvaci[{ iindex }].length] = "{ idcollection }";
<!--#endin getnextcol -->
<!--#endin getnexttype -->

function mmvac(index)
{
	var f = document.forms['rightsedit'];
	f.cbalance.selectedIndex = tabvacb[index];

	for (i = f.collid.length; i >= 3; i--) {
		f.collid.options[i] = null; 
	}

	if (tabvacn && tabvacn[index]) {
		for (var i = 0; i < tabvacn[index].length; i++)
		{
		f.collid.options[i+3] = new Option(tabvacn[index][i],tabvaci[index][i]);
		}
	}
}

mmvac(tpsel);

<!--#if arr[collid] -->
document.forms['rightsedit'].collid.value = '{ arr[collid] }';
<!--#endif arr[collid] -->

<!--#endif arr[idvr] -->

function validateNum(field) {
	var valid = ".0123456789"
	var ok = "yes";
	var temp;
	for (var i=0; i<field.value.length; i++) {
	temp = "" + field.value.substring(i, i+1);
	if (valid.indexOf(temp) == "-1") ok = "no";
	}
	if (ok == "no") {
	var dd;
	alert('{ invalidentry1 }');
	field.focus();
	field.select();
	   }
}

function onUser(id, fn)
{
	var f = document.forms['rightsedit'];
	f.collid.options[0].selected = true;
	f.id_creditorDisplay.value=fn;
	f.id_creditor.value=id;
	this.focus();
	op.close();
}

var op = null;
function openPopup(url)
{
	var f = document.forms['rightsedit'];
	var id_type = '0';

	if (f.id_type.selectedIndex >= 0) {
		id_type = f.id_type.options[f.id_type.selectedIndex].value;
	}
	var nurl = url+'&idtype='+id_type+'&cb=onUser';

	if( op == null || op.closed )
		op = this.open(nurl, 'babuserslist', 'width=550,height=550,status=no,resizable=yes,top=200,left=200,scrollbars=yes');
	else
		{
		op.location = nurl;
		op.focus();
		}
}

function onCollection()
{
	var f = document.forms['rightsedit'];
	f.id_creditor.value ='';
	f.id_creditorDisplay.value ='';
	this.focus();
}

function babReset()
{
	var f = document.forms['rightsedit'];
	f.collid.options[0].selected = true;
	f.id_creditor.value ='';
	f.id_creditorDisplay.value ='';
}

function updateDates(elemDay, elemMonth, elemYear)
{
	ds = elemDay.selectedIndex;
	timeA = new Date(elemYear.options[elemYear.selectedIndex].text, elemMonth.options[elemMonth.selectedIndex].value,1);
	timeDifference = timeA - 86400000;
	timeB = new Date(timeDifference);
	var daysInMonth = timeB.getDate();
	for (var i = 0; i < elemDay.length; i++)
	{
	elemDay.options[0] = null;
	}
	for (var i = 0; i < daysInMonth; i++)
	{
	elemDay.options[i] = new Option(i+1);
	}
	if( ds < daysInMonth )
	elemDay.options[ds].selected = true;
	else
	elemDay.options[daysInMonth-1].selected = true;
}

//-->
</script>
<!--#end rightsedit -->


<!--#begin vrpersonnellist -->


<form method="post" action="{ babPhpSelf }" name="listform">
<input type="hidden" name="tg" value="vacadma">
<input type="hidden" name="idx" value="delvru">
<input type="hidden" name="idvr" value="{ idvr }">
<input type="hidden" name="pos" value="{ pos }">
<table border="0" width="95%" cellpadding="2" cellspacing="0" align="center">
<tr> 
<td class="BabLoginCadreBackground" align="center" valign="middle"> 
	<table  width="100%" border="0" cellspacing="0" cellpadding="3" align="center">
	<tr class="BabSiteAdminTitleFontBackground"> 
		<td colspan="4" class="BabLetterlists">
		<!--#if allselected "== 1" -->
		{ allname }&nbsp;
		<!--#else allselected -->
		<a href="{ allurl }">{ allname }</a>&nbsp;
		<!--#endif allselected -->
		<!--#in getnextselect -->
		<!--#if selected "== 1" -->
		{ selectname }&nbsp;
		<!--#else selected -->
		<a href="{ selecturl }">{ selectname }</a>&nbsp;
		<!--#endif selected -->
		<!--#endin getnextselect -->
		</td>
	</tr>
	<tr class="BabSiteAdminTitleFontBackground">         
		<td width="1%">
			<a href="javascript:onCheckAll('userids', true)"><img src="{ babSkinPath }images/Puces/Pucecheked.gif" alt="{ checkall }" width="10" height="10" border="0"></a><a href="javascript:onCheckAll('userids', false)"><img src="{ babSkinPath }images/Puces/PuceUncheked.gif" alt="{ uncheckall }" width="10" height="10" border="0"></a></td>
			<td><a href="{ fullnameurl }">{ fullname }</a>
		</td>
		<td>{ quantitytxt }</td>
		<td>{ t_used }</td>
	</tr>
	<!--#in getnext -->
	<!--#if bview -->
	<!--#if altbg --><tr class="BabSiteAdminFontBackground"><!--#else altbg --><tr class="BabForumBackground1"><!--#endif altbg -->
		<td> 
			<input type="checkbox" name="userids[]" value="{ userid }" { selected } />
			<input type="hidden" name="nuserids[]" value="{ nuserid }" />
		</td>
		<td>{ urlname }</td>
		<td>{ quantity }</td>
		<td>{ used }</td>
	</tr> 
	<!--#endif bview -->
	<!--#endin getnext -->
	</table>
</td>
</tr>
</table>
<br />
<div align="center">
	<input type="submit" value="{ modify }" /> &nbsp;
	<input type="button" onclick="window.close()" value="{ t_close }" />
</div>
</form>

<!--#end vrpersonnellist -->

<!--#begin browseusers -->
<table  width="95%" border="0" cellspacing="0" cellpadding="2" align="center">
<tr> 
<td class="BabMailBackground" align="center" valign="middle"> 
<table  width="100%" border="0" cellspacing="0" cellpadding="2" align="center">
<tr valign="middle"> 
<td colspan="5" nowrap class="BabLetterlists">
<!--#if allselected "== 1" -->
{ allname }<img src="{ babSkinPath }images/Puces/Space1PxTrans.gif" alt="" width="5" height="1" border="0">
<!--#else allselected -->
<a class="BabAlphabetLink" href="{ allurl }">{ allname }</a><img src="{ babSkinPath }images/Puces/Space1PxTrans.gif" alt="" width="5" height="1" border="0">
<!--#endif allselected -->
<!--#in getnextselect -->
<!--#if selected "== 1" -->
{ selectname }<img src="{ babSkinPath }images/Puces/Space1PxTrans.gif" alt="" width="5" height="1" border="0">
<!--#else selected -->
<a class="BabAlphabetLink" href="{ selecturl }">{ selectname }</a><img src="{ babSkinPath }images/Puces/Space1PxTrans.gif" alt="" width="5" height="1" border="0">
<!--#endif selected -->
<!--#endin getnextselect -->
</td>
</tr>
<tr class="BabSiteAdminTitleFontBackground" valign="middle"> 
<td  width="1%" align="right" nowrap><img src="{ babSkinPath }images/Puces/Space1PxTrans.gif" alt="" width="1" height="1" border="0"></td>
<td><a class="BabSiteAdminListLink" href="{ fullnameurl }">{ fullname }</a></td>
<td>{ nickname }</td>
</tr>
<!--#in getnext -->
<!--#if bview -->
<tr valign="middle" class="BabSiteAdminFontBackground"> 
<td width="1%" align="right" nowrap><img src="{ babSkinPath }images/Puces/Space1PxTrans.gif" alt="" width="1" height="1" border="0"></td>
<td><a  href="#" onclick="self.opener.{ cb }({ userid }, '{ firstlast }')">{ urlname }</a> </td>
<td>{ arr[nickname] }</td>
</tr>
<!--#endif bview -->
<!--#endin getnext -->
</table>
</td>
</tr>
</table>
<!--#end browseusers -->

<!--#begin viewvacright -->


<table width="95%" border="0" cellspacing="0" cellpadding="2" align="center">
<tr>
<td class="BabLoginCadreBackground"> 
	<table class="BabLoginMenuBackground" width="100%" border="0" cellspacing="0" cellpadding="8" align="center">
	<tr>
		<td align="right" width="50%">{ typetxt }:</td>
		<td>{ type }</td>
	</tr>
	<tr>
		<td align="right">{ quantitytxt }:</td>
		<td>{ quantity }</td>
	</tr>
	<tr>
		<td align="right">{ creditortxt }:</td>
		<td>{ creditor }</td>
	</tr>
	<tr>
		<td align="right">{ dateentrytxt }:</td>
		<td>{ dateentry }</td>
	</tr>
	<tr>
		<td align="right">{ datebegintxt }:</td>
		<td>{ datebegin }</td>
	</tr>
	<tr>
		<td align="right">{ dateendtxt }:</td>
		<td>{ dateend }</td>
	</tr>
	<!--#if bvalidperiod -->
	<tr>
		<td align="right" valign="top">{ validperiodtxt }:</td>
		<td>
		{ t_from } { datebeginvalid }<br />
		{ t_to } { dateendvalid }
		</td>
	</tr>
	<!--#endif bvalidperiod -->
	<tr>
		<td align="right">{ statustxt }:</td>
		<td>{ status }</td>
	</tr>
	</table>
	</td>
</tr>
</table>

<!--#end viewvacright -->


<!--#begin rightsdelete -->
<table width="60%" border="0" cellspacing="0" cellpadding="2" align="center">
	<tr> 
		<td class="BabLoginCadreBackground"> 
			<table class="BabLoginMenuBackground" width="100%" border="0" cellspacing="0" cellpadding="10">
			
			<tr> 
				<td>
					<h5>{ t_alert }</h5>

					<p>
						{ t_request } : { request }
					</p>
					<p>
						{ t_nb_requests }
					</p>
					
					<form method="post" action="{ babPhpSelf }">
						<input type="hidden" name="tg" value="vacadma" />
						<input type="hidden" name="idx" value="lrig" />
						<input type="hidden" name="action" value="delete" />
						<input type="hidden" name="idvr" value="{ idvr }" />
						<p align="center">
							<input type="submit" name="confirmed" value="{ t_confirm }" />
						</p>
					</form>
				</td>
			</tr>

			</table>
		</td>
	</tr>
</table>
<!--#end rightsdelete -->

<!--#begin rgrouplist -->

<table width="60%" border="0" cellspacing="0" cellpadding="2" align="center">
	<tr> 
		<td class="BabLoginCadreBackground"> 
			<table width="100%" border="0" cellspacing="0" cellpadding="5">
			
			<tr class="BabSiteAdminTitleFontBackground"> 
				<td>{ t_name }</td>
				<td>{ t_rights }</td>
				<td>{ t_edit }</td>
			</tr>
			<!--#in getnext -->
			<!--#if altbg --><tr class="BabSiteAdminFontBackground"><!--#else altbg --><tr class="BabForumBackground1"><!--#endif altbg -->
				<td valign="top">{ name }</td>
				<td valign="top">
					<!--#in getnextright -->
					{ description }<br />
					<!--#endin getnextright -->
				</td>
				<td valign="top"><a href="{ babUrlScript }?tg=vacadma&amp;idx=rgroupmod&amp;id_rgroup={ id_rgroup }"><img src="{ babSkinPath }images/Puces/edit.gif" border="0" alt="{ t_edit }" /></a></td>
			</tr>
			<!--#endin getnext -->
			</table>
		</td>
	</tr>
</table>
<!--#end rgrouplist -->


<!--#begin rgroupmod -->
<form method="post" action="{ babPhpSelf }">
<input type="hidden" name="tg" value="vacadma" />
<input type="hidden" name="idx" value="rgroup" />
<input type="hidden" name="action" value="rgroupmod" />
<input type="hidden" name="id_rgroup" value="{ id_rgroup }" />
<table width="60%" border="0" cellspacing="0" cellpadding="2" align="center">
	<tr> 
		<td class="BabLoginCadreBackground"> 
			<table class="BabLoginMenuBackground" width="100%" border="0" cellspacing="0" cellpadding="5">
			
			<tr> 
				<td align="right">{ t_name } :</td>
				<td><input type="text" name="name" value="{ name }" size="50" /></td>
			</tr>

			<tr>
				<td colspan="2" align="center">
					<br />
					
					<input type="submit" value="{ t_record }" />
					<!--#if id_rgroup --> &nbsp; 
					<input type="submit" name="rgroup_delete" value="{ t_delete }" />
					<!--#endif id_rgroup -->
					<br />
					<br />
				</td>
			</tr>
			</table>
		</td>
	</tr>
</table>
</form>
<!--#end rgroupmod -->



<!--#begin rightcopy -->
<form name="copy" method="post" action="{ babPhpSelf }">
<input type="hidden" name="tg" value="vacadma" />
<input type="hidden" name="idx" value="copy" />
<table width="60%" border="0" cellspacing="0" cellpadding="2" align="center">
	<tr> 
		<td class="BabLoginCadreBackground"> 
			<table class="BabLoginMenuBackground" width="100%" border="0" cellspacing="0" cellpadding="5">
			
			<tr> 
				<td>
				<p>{ t_year_from } :
					<select name="year_from" onchange="document.forms['copy'].submit()">
						<!--#in getnextyear -->
						<option value="{ year }" <!--#if selected --> selected="selected"<!--#endif selected -->>{ year }</option>
						<!--#endin getnextyear -->
					</select>
				</p>
				<!--#in year_to --><!--#endin year_to -->
				<p><br /></p>

				<blockquote>
				
				<!--#in getnextright -->
				<p>
					<input type="checkbox" name="rights[{ id_right }]" id="bab_vac_right_{ id_right }" value="{ id_right }" <!--#if checked --> checked="checked" <!--#endif checked --> /> 
					<label for="bab_vac_right_{ id_right }">{ right_description }</label>
				</p>
				<!--#endin getnextright -->

				</blockquote>

				<p><br /></p>
				
				<p>{ t_year_to } : <input type="text" name="year_to" value="{ year_to }" maxlength="4" size="4" /></p>
				
				<p align="center"><input type="submit" name="copy_rights" value="{ t_record }" /></p>
				</td>
			</tr>
			</table>
		</td>
	</tr>
</table>
</form>
<!--#end rightcopy -->


<!--#begin rightcopy2 -->
<table width="60%" border="0" cellspacing="0" cellpadding="2" align="center">
	<tr> 
		<td class="BabLoginCadreBackground"> 
			<table class="BabLoginMenuBackground" width="100%" border="0" cellspacing="0" cellpadding="5">
			
			<tr> 
				<td>
					<!--#in getnextmessage -->
					<p>{ message }</p>
					<!--#endin getnextmessage -->
					
				</td>
			</tr>
			</table>
		</td>
	</tr>
</table>
<!--#end rightcopy2 -->